<?php /* Smarty version Smarty-3.1.18, created on 2017-05-17 08:24:50
         compiled from "/data/www/mystery/protected/modules/webadmin/views/report/list.tpl" */ ?>
<?php /*%%SmartyHeaderCode:10874455245551b055962db5-21129051%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '2f72dd20cc711b87e49e532ed5684a506abe1cf4' => 
    array (
      0 => '/data/www/mystery/protected/modules/webadmin/views/report/list.tpl',
      1 => 1494904926,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '10874455245551b055962db5-21129051',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_5551b0559f1919_99503396',
  'variables' => 
  array (
    'project_list' => 0,
    'project_id' => 0,
    'val' => 0,
    'list' => 0,
    'audit' => 0,
    'status' => 0,
    'page' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5551b0559f1919_99503396')) {function content_5551b0559f1919_99503396($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include '/data/www/mystery/protected/extensions/Smarty/plugins/modifier.date_format.php';
?><?php echo $_smarty_tpl->getSubTemplate ("../common/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<table width="100%" border="0" cellspacing="0">
 <tr>
    <td width="13%" valign="top">
            <?php echo $_smarty_tpl->getSubTemplate ("../common/left.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

    </td>
    <td width="87%" valign="top">
        
        <table width="100%" border="0" cellspacing="0">
                <tr>
                <td>
                    <form name="form1" id="form1" method="get" action="/webadmin/report/index">
                    <div class="subnav">
                        <div class="content-menu ib-a blue line-x">
                        <a href="#" class="on"><em>网点报备</em></a><span>
                            项目<select name="project_id" autocomplete="off">
                                <option value="">--请选择--</option>
                                <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['project_list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                                <option <?php if ($_smarty_tpl->tpl_vars['project_id']->value) {?>selected<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['val']->value['project_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['val']->value['project_name'];?>
</option>
                                <?php } ?>
                            </select>
                            <select name="op" id="op">
                                <option value="sel">查询</option>
                                <option value="del">删除</option>
                                <option value="export">导出Excel</option>
                                <option value="attach">下载附件</option>
                            </select>
                        <input type="submit" value="操作" class="button" name="dosubmit">
                        <div class="clearbox"></div>  
                        </div>
                    </div>
                    </form>
              <div class="pad_10">
                <div class="table-list">
                    <form name="form2" id="form2" method="post" action="/webadmin/report/Del">
                <table width="100%">
                      <thead>
                        <tr>
                            <th>选择</th>
                            <th>网点名称</th>
                            <th>项目名称</th>
                            <th>报备内容</th>
                            <th>报备时间</th>
                            <th>创建时间</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                        <tr  onMouseOver="this.className='tr2'" onMouseOut="this.className='tr1'" class="tr1" id="nr_<?php echo $_smarty_tpl->tpl_vars['val']->value['nr_id'];?>
">
                            <td><input type="checkbox" name="nr_id[]" value="<?php echo $_smarty_tpl->tpl_vars['val']->value['nr_id'];?>
"/></td>
                            <td align="center"><?php echo $_smarty_tpl->tpl_vars['val']->value['network_info']['network_name'];?>
</td>
                            <td align="center"><?php echo $_smarty_tpl->tpl_vars['val']->value['project_info']['project_name'];?>
</td>
                            <td align="center"><?php echo $_smarty_tpl->tpl_vars['val']->value['content'];?>
</td>
                            <td align="center"><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['start_time'],"%Y-%m-%d");?>
-<?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['end_time'],"%Y-%m-%d");?>
</td>
                            <td align="center"><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['create_time'],"%Y-%m-%d");?>
</td>
                            <td align="center"><a href="javascript:;" title="点击查看审核历史" onclick="history('<?php echo $_smarty_tpl->tpl_vars['val']->value['nr_id'];?>
');"><?php echo $_smarty_tpl->tpl_vars['audit']->value[$_smarty_tpl->tpl_vars['val']->value['audit']];?>
<?php echo $_smarty_tpl->tpl_vars['status']->value[$_smarty_tpl->tpl_vars['val']->value['status']];?>
</a></td>
                            <td align="center">
                                <a href="javascript:;" onclick="del(<?php echo $_smarty_tpl->tpl_vars['val']->value['nr_id'];?>
);">删除</a>
                                <?php if ($_smarty_tpl->tpl_vars['val']->value['haveattach']) {?> | <a href="javascript:;" onclick="attachment(<?php echo $_smarty_tpl->tpl_vars['val']->value['nr_id'];?>
);">附件</a><?php }?>
                            </td>
                        </tr>
                        <?php } ?>
                        <tr><td colspan="2">
                                <input type="checkbox" id="che_box" /><input type="submit" class="button" value="批量删除" />
                            </td>
                            <td colspan="6"><?php echo $_smarty_tpl->tpl_vars['page']->value;?>
</td>
                        </tr>
                      </tbody>
                </table>
                    </form>
                </div>
              </div>
    </td>
 </tr>
</table>
<script type="text/javascript">
    function del(nr_id){
        if (confirm('确定删除？')) {
            $.getJSON('/webadmin/report/Del',{nr_id:nr_id},function(res){
                if (res.status==1) {
                    $('#nr_'+nr_id).remove();
                }
                alert(res.note);
            });
        }
    }
    $('#op').change(function(){
        var v = $(this).val();
        if (v == 'del') {
            $('#form1').attr('action','/webadmin/report/DelProject');
        }
        if (v == 'sel') {
            $('#form1').attr('action','/webadmin/report/Index');
        }
        if (v == 'export') {
            $('#form1').attr('action','/webadmin/report/ExportProject');
        }
        if (v == 'attach') {
            $('#form1').attr('action','/webadmin/attach/DownProjectReport');
        }
        
    });
    $(function(){
            //复选框事件  
        //全选、取消全选的事件  
        $(document).on("click","#che_box",function(){
            var ischecked= $("#che_box:checked").length;

            var $checkboxs =$("input[name='nr_id[]']");
            if(ischecked){
                $checkboxs.prop("checked",true);
            }else{
                $checkboxs.prop("checked",false);
            }
        });
        var options = {         
            beforeSubmit:  showRequest,  
            success:       showResponse,
            dataType:  'json'
        }
        $('#form2').ajaxForm(options); 
        
        
    })
function showRequest(formData, jqForm, options) { 
    return true;
}
function showResponse(responseText, statusText, xhr, $form)  { 
    alert(responseText.note); 
    if (responseText.status==1) {
        window.location.reload();
    }
    
}
     //上传问卷对标附件
 function attachment(nr_id){
  $.layer({
      type: 2,
      title: '网点报备附件列表',
      closeBtn: [0, true],
      shade: [0.5, '#000'],
      border:[10, 0.3, '#000'],
      offset: ['150px',''],
      area: ['550px', '400px'],
      iframe: {src: '/webadmin/report/attachment?nr_id='+nr_id}
  });  
}//详细审核历史记录
function history(nr_id){
    $.layer({
        type: 2, 
        title: '网点报备审核历史记录',
        border:[10, 0.3, '#000'],
        closeBtn:[0, true],
        shade: [0.5, '#000'],
        offset: ['100px', ''],
        area: ['500px', '450px'],
        iframe: {src: '/webadmin/report/history?nr_id='+nr_id}
    });
}
</script>
<?php echo $_smarty_tpl->getSubTemplate ("../common/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
